# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=rulesfinder
pkgver=42.cf8255b
pkgrel=1
pkgdesc='Machine-learn password mangling rules.'
groups=('blackarch' 'blackarch-misc')
url='https://github.com/synacktiv/rulesfinder'
arch=('x86_64' 'aarch64')
license=('custom:unknown')
depends=('gcc-libs')
makedepends=('git' 'cargo')
source=("git+https://github.com/synacktiv/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  cargo build --release
}

package() {
  cd $pkgname

  install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
}

